home *** CD-ROM | disk | FTP | other *** search
- /*
- File: QDFixM.h
-
- Contains: Fix for QuickDraw.h [Mac Only]
-
- Written by: Jens Alfke
-
- Copyright: © 1993-94 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <1> 1/25/95 jpa first checked in
- ---Moved to ODSOM:Interfaces:Handmade:
- <3> 9/14/94 jpa Commented out #error so people can use
- standard precompiled headers. Of course, if
- QuickDraw.h is included before me, the fix
- will NOT take effect...
- <2> 8/18/94 TÇ #1181622 Removed my name from the Written
- By: field
- <1> 7/19/94 jpa first checked in
- To Do:
-
- Theory of Operation:
-
- We've had a lot of trouble with QuickDraw.h defining an enum constant
- called "frame" whose value is zero. If a function uses a local variable
- "frame" but forgets to define it, the global frame is used instead. Since
- it's zero, which can be cast implicitly to NULL, this usually results in a
- null pointer being used instead of an XMPFrame, leading to obscure crashes
- later on. We have spent literally days tracking down problems stemming
- from this.
- To fix this, we employ some sleight-of-hand to prevent QuickDraw.h from
- defining that constant by renaming it "kQDFrameVerb". This way the
- compiler will properly generate a syntax error if some schmuck forgets
- to declare a local "frame" variable.
-
- This header should be included before <QuickDraw.h>.
- This header is included by ODTypesF.h.
-
- In Progress:
- */
-
-
- #ifndef _QDFIXM_
- #define _QDFIXM_
-
- #ifdef __QUICKDRAW__
- /* #error "Yo! Please include QDFix.h _before_ QuickDraw.h!" */
- #else
- #undef frame
- #define frame kQDFrameVerb // Use this instead of "frame" in QD grafProcs.
- #include <QuickDraw.h>
- #undef frame
- #endif
-
- #endif /*_QDFIXM_*/